// if networks are attached, they need to be detached before the policy can be deleted
if d.Get("networks.#").(int) > 0 {
	patched := make(map[string]interface{})
	patched["networks"] = nil

	url, err := replaceVars(d, config, "{{DNSBasePath}}projects/{{project}}/policies/{{name}}")
	if err != nil {
		return err
	}

	_, err = sendRequestWithTimeout(config, "PATCH", project, url, userAgent, patched, d.Timeout(schema.TimeoutUpdate)<%= object.error_retry_predicates ? ", " + object.error_retry_predicates.join(',') : "" -%>)
	if err != nil {
		return fmt.Errorf("Error updating Policy %q: %s", d.Id(), err)
	}
}
